<?php
namespace EM\NewsBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class UserType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('firstname', 'text', array('attr' => array('class' => 'validate[required,maxSize[250]]') ))
                ->add('lastname', 'text', array('attr' => array('class' => 'validate[required,maxSize[250]]') ))
               ->add('username', 'text', array('attr' => array('class' => 'validate[required,maxSize[15]]') ))
                ->add('email', 'text', array('attr' => array('class' => 'validate[required,maxSize[255]]') ))
                ->add('password','password', array('attr' => array('class' => 'validate[required,maxSize[10]]'),'always_empty'=>false))
               ->add('isActive', 'choice', array(
    'choices'   => array(1 => 'true', 0 => 'false'),
    'required'  => false,
));
			   // ->add('password','choice', array('SI' => true,'NO'=>false));
			/*	->add('rol', 'entity',array('label' => 'Rol: ',
						'empty_value' => 'Choose a rol',
						'class' => 'EMNewsBundle:Roles',
						'property' => 'name',
						'attr' => array('class' => 'validate[required]')
						))
				->add('country', 'entity',array('label' => 'Country: ',
						'empty_value' => 'Choose a country',
						'class' => 'EMNewsBundle:Countries',
						'property' => 'country',
						'attr' => array('class' => 'validate[required]')
						));*/
		
    }
    public function getName()
    {
        return 'user_form';
    }
	
}

